<%@ page language="java" pageEncoding="UTF-8"%>
<%@page import="java.util.List"%>
<%@page import="com.zzt.system.entity.Role"%>
<%@page import="java.util.ArrayList"%>
<%
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ request.getContextPath();
			
	List<Role> roles = new ArrayList<Role>();
	
	if(session.getAttribute("roleInfo") != null){
		roles = (List<Role>)session.getAttribute("roleInfo");
	}
	
%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>


<script type="text/javascript">
  function showUserMenu()
  {
      if($('#_main_face_menu').is(":hidden"))
      {
         $('#_main_face_menu').fadeIn();
        $('.user-avatar').addClass('user-avatar-hover');
      }else
      {
         $('#_main_face_menu').hide();
         $('.user-avatar').removeClass('user-avatar-hover');
      }
      
  }
  
  
  $(function(){
     $(".user-avatar").mouseenter(function(){
       $(".user-avatar").addClass('user-avatar-hover');
       $('#_main_face_menu').fadeIn();
     });
     
     $("#_main_face_menu").mouseleave(function(){
       $(".user-avatar").removeClass('user-avatar-hover');
       $('#_main_face_menu').fadeOut();
     });
  });
   
</script>


<div id="_main_fixed_header" class="header-fixed">

	<!-- 头部 -->
	<div id="_main_header_banner" class="header">
		<div id="_main_header_cnt" class="header-cnt">
			<div class="logo" style="left: -200px;">
			</div>
			<!-- 头像 -->
			<div id="_main_face" data-no-selection="" class="header-right"
				style="cursor: pointer;" onclick="showUserMenu();">
				<span class="user-info"> <span class="user-avatar"
					style="width: 80px;"> <img
							src="<%=basePath%>/management/resource/img/icon.png"><i
						class="ui-arr"></i> </span> </span>
			</div>
			<!-- 头像下方的菜单 -->
			<div id="_main_face_menu" style="display: none;"
				class="ui-pop ui-pop-user">
				<div class="ui-pop-head">
					<span id="_main_nick_name" class="user-nick"
						style="text-align: center; font-weight: bold; color: #555168; font-size: 18px;">${
						sessionScope.currentUser.cmname }</span>

					<span class="user-nick"
						style="line-height: 16px; text-align: center; font-weight: bold; color: #3B20BB; font-size: 12px;">
						<%=roles.size()>0?roles.get(0).getRoleName():"" %></span>

				</div>

				<ul class="ui-menu">
					<li>
						<a id="_main_logout" href="javascript:doShowDialog('aboutDialog')"><i
							class="icon-fedbk"></i>个人信息</a>
						<a id="_main_logout"
							href="javascript:doShowDialog('updatePwdDialog')"><i
							class="icon-pwd"></i>修改密码</a>
						<a id="_main_logout" href="login!loginOut.action"><i
							class="icon-exit"></i>注销</a>
					</li>
				</ul>
				<i class="ui-arr"></i>
				<i class="ui-arr ui-tarr"></i>
			</div>
		</div>
	</div>



</div>

<!-- 个人信息窗口begin -->
<div class="panel panel-primary gdialog" id="aboutDialog"
	style="display: none; width: 400px; position: absolute;">
	<div class="panel-heading">
		个人信息
		<a class="close" onclick=doHideDialog('aboutDialog');
>&times;</a>
	</div>
	<div class="panel-body">
		<ul class="list-group">
			<li class="list-group-item">
				姓名：${ sessionScope.currentUser.cmname }
			</li>
			<li class="list-group-item">
				职务/角色：
				<c:forEach items="<%=roles %>" var="role">${ role.roleName }、</c:forEach>
			</li>
			<li class="list-group-item">
				email:${ sessionScope.currentUser.cmemail }
			</li>
		</ul>
	</div>
</div>
<!-- 个人信息窗口end -->

<!-- 修改密码窗口begin -->
<div class="panel panel-primary gdialog" id="updatePwdDialog"
	style="display: none; width: 400px; position: absolute;">
	<div class="panel-heading">
		修改密码
		<a class="close" onclick="doHideDialog('updatePwdDialog');">&times;</a>
	</div>
	<div class="panel-body">
		<ul class="list-group" style="text-align: center;">
			<li class="list-group-item">
				旧 密 码 ：
				<input name="oldPwd" />
			</li>
			<li class="list-group-item">
				新 密 码 ：
				<input name="newPwd" />
			</li>
			<li class="list-group-item">
				重复密码：
				<input name="newPwd2" />
			</li>
			<li class="list-group-item">
				<button type="button" class="btn blue" onclick="checkForm()">
					<i class="icon-ok"></i> Save
				</button>
				<button type="button" class="btn"
					onclick="doHideDialog('updatePwdDialog')">
					Cancel
				</button>
			</li>
		</ul>
	</div>
</div>
<!-- 修改密码窗口end -->

<div id="global_mask"
	style="display: none; position: absolute; top: 0px; left: 0px; z-index: 998; background-color: rgb(190, 209, 216); opacity: 0.5; width: 100%; height: 100%; overflow: hidden; background-position: initial initial; background-repeat: initial initial;"></div>
